<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:background-repeat="http://www.w3.org/1999/xhtml"
      xmlns:background="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>登录--后台管理模板</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="layui/css/layui.css" media="all"/>
    <script type="text/javascript" src="layui/layui.js"></script>

    <style>
        body {
            overflow: hidden;
        }



        .login {
            height: 260px;
            width: 260px;
            padding: 20px;
            border-radius: 4px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin: -150px 0 0 -150px;
            z-index: 99;
            background: rgba(0, 0, 0, 0.5);
        }
        .bg {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            background: rgba(25, 123, 48,0.5)  url("img/srclogin.jpg") no-repeat;
            background-size: 100%;
        }
        .login h1 {
            text-align: center;
            color: #fff;
            font-size: 24px;
            margin-bottom: 20px;
        }

        .form_code {
            position: relative;
        }

        .form_code .code {
            position: absolute;
            right: 0;
            top: 1px;
            cursor: pointer;
        }

        .login_btn {
            width: 100%;
        }
    </style>
</head>
<body>


<div class="bg" >
<div class="login"  method="post">
    <h1>limter-CMS-管理登录</h1>
    <form class="layui-form" action="/limiter/login" method="post">
        <div class="layui-form-item">
            <input class="layui-input" name="username" placeholder="用户名" lay-verify="required" type="text"
                   autocomplete="off">
        </div>
        <div class="layui-form-item">
            <input class="layui-input" name="password" placeholder="密码" lay-verify="required" type="password"
                   autocomplete="off">
        </div>
<!--        <span style="color:red" th:if="${param.error}" th:text="${session?.SPRING_SECURITY_LAST_EXCEPTION?.message}" ></span>-->
        <span style="color:red" th:if="${param.error}" th:text="用户名密码错误" ></span>
        <button class="layui-btn login_btn" lay-submit="" lay-filter="login">登录</button>
    </form>
</div>
</div>

<script>
    // layui.use(['form', 'layedit', 'laydate'], function () {
    //     var form = layui.form
    //     //登录按钮事件
    //     form.on("submit(login)", function (data) {
    //         var username = data.field.username;
    //         var password = data.field.password;
    //         $.ajax({
    //             url: 'login',
    //             data: {
    //                 "username":username,
    //                 "password":password
    //             },
    //             type: "POST",
    //             contentType:"application/x-ww-form-urlencoded",
    //             success: function (data) {
    //                 layer.msg("提交成功")
    //                 window.location.href = "/home.html";
    //             },
    //             error: function (data) {
    //                 layer.msg("登录失败")
    //             }
    //
    //         });
    //     });
    // });


</script>
</body>
</html>